package com.childmiles.gwt.client;

import com.childmiles.gwt.client.ui.MainActivity;
import com.childmiles.gwt.client.ui.MainDisplayImpl;
import com.google.gwt.app.place.Activity;
import com.google.gwt.app.place.ActivityManager;
import com.google.gwt.app.place.ActivityMapper;
import com.google.gwt.app.place.Place;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.ui.RootLayoutPanel;

/**
 * Entry point classes define <code>onModuleLoad()</code>.
 */
public class Application implements EntryPoint {

	private final EventBus eventBus = new HandlerManager(null);
//	private final PlaceController placeController = new PlaceController(eventBus);
	private final MainDisplayImpl display = new MainDisplayImpl();
	private final ActivityMapper mapper = new ActivityMapper() {
    	final MainActivity ma = new MainActivity(display);
    	
		public Activity getActivity(Place place) {
			return ma;
		}
	};
    private final ActivityManager manager = new ActivityManager(mapper, eventBus);

    /**
     * This is the entry point method.
     */
    public void onModuleLoad() {
        RootLayoutPanel.get().add(display);
        manager.setDisplay(display);
    }
    
    
}
